#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int D = 0;
    int ret = 0;
    scanf("%d", &D);
    if (D <= 5)
    {
        ret = D + 2;
    }
    else if (D == 6)
    {
        ret = 1;
    }
    else
        ret = 2;
    printf("%d\n", ret);
    return 0;
}